﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interfaces;
using System.ServiceModel;
using Domain;

namespace EmployeeModule
{
    public class EmployeeService : ClientBase<IEmployeeService>, IEmployeeService
    {
        public List<Employee> GetEmployees(string lastNameBeginsWith)
        {
            using (OperationContextScope context = new OperationContextScope(this.InnerChannel))
            {
                return base.Channel.GetEmployees(lastNameBeginsWith);
            }
        }

        public Person SavePerson(Person person)
        {
            using (OperationContextScope context = new OperationContextScope(this.InnerChannel))
            {
                return base.Channel.SavePerson(person);
            }
        }

        public Employee GetEmployee(int id)
        {
            using (OperationContextScope context = new OperationContextScope(this.InnerChannel))
            {
                return base.Channel.GetEmployee(id);
            }
        }
    }
}
